package o;

public class avn {
    private static final char[] ˋ = "0123456789ABCDEF".toCharArray();

    public static String ˏ(byte[] bArr) {
        StringBuilder stringBuilder = new StringBuilder(bArr.length * 2);
        for (byte b : bArr) {
            stringBuilder.append(ˋ[(b >> 4) & 15]);
            stringBuilder.append(ˋ[b & 15]);
        }
        return stringBuilder.toString();
    }

    public static byte[] ॱ(String str) {
        return ˎ(str.toCharArray());
    }

    private static byte[] ˎ(char[] cArr) {
        int i = 0;
        if ((cArr.length & 1) != 0) {
            throw new IllegalArgumentException("Odd number of characters.");
        }
        byte[] bArr = new byte[(cArr.length >> 1)];
        int i2 = 0;
        while (i < cArr.length) {
            int digit = Character.digit(cArr[i], 16);
            if (digit == -1) {
                throw new IllegalArgumentException("Illegal hexadecimal character at index " + i);
            }
            i++;
            int digit2 = Character.digit(cArr[i], 16);
            if (digit2 == -1) {
                throw new IllegalArgumentException("Illegal hexadecimal character at index " + i);
            }
            i++;
            bArr[i2] = (byte) (((digit << 4) | digit2) & 255);
            i2++;
        }
        return bArr;
    }
}
